﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AjaxPage.aspx.cs" Inherits="AjaxPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        var AjaxPage = function () {
            var obj = {
                txtFNameId: 'txtFName',
                txtLNameId: 'txtLName',

                CollectData: function () { alert('ajaxPage Data Collected'); },
                SaveData: function () {
                    alert('Save Data Called.');
                    var fname = document.getElementById(this.txtFNameId).value;
                    var lname = document.getElementById(this.txtLNameId).value;

                    alert(fname + ' ' + lname + ' ajaxPage Data Saved');
                }
            }

            return obj;
        } ();
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input type="text" id="txtFName" value=" " />
        <input type="text" id="txtLName" value=" " />
        <input type="button" name="btnSave" value="Click me" onclick="javascript:AjaxPage.SaveData();" />
    </div>
    </form>
</body>
</html>
